import { WorkbenchProductComponent } from './workbench-product/workbench-product.component';
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { ProductrootComponent } from './product.component';
import { ProductJobComponent } from './product-job/product-job.component';
import { AddProductJobComponent } from './product-job/add-product-job/add-product-job.component';
import { ViewProductJobComponent } from './product-job/view-product-job/view-product-job.component';
import { EditProductJobComponent } from './product-job/edit-product-job/edit-product-job.component';
import { ProductDispatchListComponent } from './product-dispatch-order/product-dispatch-list/product-dispatch-list.component';
import { ProductJobPinkComponent } from './product-job-pink/product-job-pink.component';
import { AddPickingListComponent } from './product-job-pink/add-picking-list/add-picking-list.component';
import { ProductWorkReportOrderComponent } from './product-work-report-order/product-work-report-order.component';
import { ScfldDetailsComponent } from './product-job-pink/scfld-details/scfld-details.component';
import { ProcessDispatchComponent } from './product-dispatch-order/process-dispatch/process-dispatch.component';
import { EditPickingListComponent } from './product-job-pink/edit-picking-list/edit-picking-list.component';
import { CanActivateGuard } from 'src/app/@core/services/can-load-service.guard';
import { LrpComponent } from './product-plan/lrp/lrp.component';
import { MrpComponent } from './product-plan/mrp/mrp.component';
import { AddLrpComponent } from './product-plan/lrp/add-lrp/add-lrp.component';

const routes: Routes = [
  {
    path: '',
    component: ProductrootComponent,
    children: [
      {
        path: 'product-job',
        component: ProductJobComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'add-product-job',
        component:AddProductJobComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'job-detail/:jobOrderId',
        component:ViewProductJobComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'edit-product-job/:jobOrderId',
        component:EditProductJobComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'product-dispatch-order',
        component:ProductDispatchListComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'product-job-pink',
        component:ProductJobPinkComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'product-job-pink/detail/:id',
        component:ScfldDetailsComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'add-picking-list',
        component:AddPickingListComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'edit-picking-list/:id',
        component:EditPickingListComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'product-work-report-order',
        component:ProductWorkReportOrderComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'process-dispatch',
        component:ProcessDispatchComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'product-workbench',
        component:WorkbenchProductComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'lrp',
        component:LrpComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'add-lrp',
        component:AddLrpComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path:'mrp',
        component:MrpComponent,
        canActivate: [CanActivateGuard]
      },
      {
        path: '',
        redirectTo: 'product-job',
        pathMatch: 'full',
      },
      {
        path: '**',
        redirectTo: 'product-job',
      },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class ProductRoutingModule { }
